package com.ruoyi.statistics.controller;


import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.statistics.domain.RevenueStatistics;
import com.ruoyi.statistics.service.IStatisticsService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/statistics")
public class StatisticsController extends BaseController {

    private final IStatisticsService statisticsService;

    /**
     * 查询团对业绩
     *
     */
    @GetMapping("/listTeam")
    public R<List<RevenueStatistics>> selectTeamRevenueList(RevenueStatistics revenueStatistics) {
        return R.ok(statisticsService.selectTeamRevenueList(revenueStatistics));
    }
    /**
     * 查询个人业绩
     *
     */
    @GetMapping("/listUser")
    public R<List<RevenueStatistics>> selectUserRevenueList(RevenueStatistics revenueStatistics) {
        return R.ok(statisticsService.selectUserRevenueList(revenueStatistics));
    }

    @GetMapping("/selectUserRevenueTotalMonth")
    public R<RevenueStatistics> selectUserRevenueTotalMonth(){
        return R.ok(statisticsService.selectUserRevenueTotalMonth());
    }
}
